BP_CameraChangeZoom
The Camera Change Zoom is a component that allows changing the distance between the player and the Camera.
How it works
To use the BP_CameraChangeZoom component, add it to a scene. It contains a Collision Box that triggers an OverlapEvent for the Character.
The component implements two main events: OnComponentBeginOverlap and OnComponentEndOverlap.
OnComponentBeginOverlap
When the Character enters a BP_CameraChangeZoom zone, the OnComponentBeginOverlap event is triggered. This sets up a Timeline, which is essentially a loop.
During this loop, the initial Camera Distance and the Target Camera Distance are interpolated (Lerped) based on the Timeline Alpha. The computed value is applied by calling the SetCameraDistance method.
Upon completion, the new Distance is saved by calling the SaveCameraDistance method.
OnComponentEndOverlap
This event is triggered when the Character exits the BP_CameraChangeZoom zone.
Technical Details
Members
CameraDistance: Float. The Camera Distance we aim for when entering the area.PlayerControllerRef: SFDemoPlayerController. A reference to the player.RestoredPrevious: Float. The previous camera distance before entering the area.
Methods
SetCameraDistance(float CameraDistance)
- Sets the Camera Distance based on the parameter.